package com.qc31.monitorlib.ui.mile

import androidx.activity.viewModels
import autodispose2.autoDispose
import com.qc31.baselib.utils.startActivityTo
import com.qc31.comlib.Keys
import com.qc31.monitorlib.R
import com.qc31.monitorlib.base.BaseReportActivity
import com.qc31.monitorlib.base.BaseReportViewModel

/** @Author Jasper @Time 2020/12/8 @Desc 日里程 */
class MileActivity : BaseReportActivity() {
    private val mViewModel: MileViewModel
            by viewModels()

    override val mBaseViewModel: BaseReportViewModel
        get() = mViewModel

    override val titleId: Int
        get() = R.string.title_report_mile

    override fun initView() {
        super.initView()
        mViewModel.mileSub.hide().autoDispose(scopeProvider).subscribe {
            startActivityTo<MileInfoActivity>(this) {
                putExtra(Keys.INTENT_TITLE, mViewModel.carName)
                putExtra(
                    Keys.INTENT_TIME,
                    "${mChooseVB.lrvStartTime.getRightText()}  ~  ${mChooseVB.lrvEndTime.getRightText()}"
                )
                putExtra(Keys.INTENT_DATA, it)
            }
        }
    }

    override fun setListener() {
        super.setListener()
    }


}